import Vue from 'vue'
import VueRouter from 'vue-router'
import GoodsList from '../views/goodsList.vue'
import shopcart from '../views/shopcart.vue'

Vue.use(VueRouter)

const routes = [
	{
		path:'/',
		redirect:'/list'
	},
  {
    path: '/list',
    name: 'GoodsList',
    component: GoodsList
  },
  {
    path: '/cart',
    name: 'shopcart',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
	component:shopcart
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
